﻿<UserControl x:Class="OI.Views.MashupMapView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:rim="clr-namespace:ISC.RIM.Silverlight;assembly=ISC.RIM.Silverlight" 
    xmlns:I="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" 
    xmlns:Projections="clr-namespace:ISC.RIM.Silverlight.Projections;assembly=ISC.RIM.Silverlight" 
    xmlns:Requestors="clr-namespace:ISC.RIM.Silverlight.Requestor;assembly=ISC.RIM.Silverlight" 
    xmlns:Controls="clr-namespace:OI.Controls" xmlns:Images="clr-namespace:OI.Images">
    
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <!--MAP-->
        <rim:Map x:Name="myMap">

            <rim:MapView EnableTileBackdrop="True" EnableMouseHoverEvents="False"
                         EnableMouseMovePositionCommand="False" EnableViewChangeCommand="False"
                         Micro:Message.Attach="[Event ViewChangeComplete] = [Action ViewChangeComplete()]; [Event MouseHover] = [Action MouseHover($eventArgs)] ; [Event MouseLeftSingleClickPosition] = [Action MouseLeftSingleClickPosition($eventArgs)] " />

            <rim:Map.TileProjection>
                <Projections:SphericalMercatorTileProjection />
            </rim:Map.TileProjection>

            <rim:Map.MapModel>
                <rim:MapModel InterlevelQuality="0.5" ExtentOverfetchFactor="1.125">

                    <rim:TileLayer x:Name="BaseMapTileLayer" Descriptor="r" FadeInDuration="0:0:0.66"
                                   MaxRequestThreads="4" ExcludeFromBackdrop="False">
                        <rim:TileLayer.TileRequestor>
                            <Requestors:BingMapsTileRequestor />
                        </rim:TileLayer.TileRequestor>
                    </rim:TileLayer>

                    <rim:TileLayer x:Name="MDNTileLayer" FadeInDuration="0:0:0.66"
                                   MaxRequestThreads="2" ExcludeFromBackdrop="True" SuspendLoadingDuringZoomAnimations="True" >
                        <rim:TileLayer.TileRequestor>
                            <Requestors:MDNSMapTileRequestor />
                        </rim:TileLayer.TileRequestor>
                    </rim:TileLayer>

                    <rim:TileLayer x:Name="DensityMapTileLayer" Key="DensityMapTileLayer" IsVisible="False"
                                   MaxRequestThreads="2" ExcludeFromBackdrop="True" SuspendLoadingDuringZoomAnimations="True" >
                        <rim:TileLayer.TileRequestor>
                            <Requestors:MDNSGeomTileRequestor BleedRatio="1.33"  />
                        </rim:TileLayer.TileRequestor>
                    </rim:TileLayer>

                    <rim:TileLayer x:Name="LabelTileLayer" Key="LabelTileLayer" IsVisible="False"
                                   MaxRequestThreads="2" ExcludeFromBackdrop="True" SuspendLoadingDuringZoomAnimations="True" >
                        <rim:TileLayer.TileRequestor>
                            <Requestors:MDNSGeomTileRequestor BleedRatio="1.0"  />
                        </rim:TileLayer.TileRequestor>
                    </rim:TileLayer>

                </rim:MapModel>
            </rim:Map.MapModel>
        </rim:Map>

        <!--NAVIGATION-->
        <Controls:Navigator x:Name="navigator" HorizontalAlignment="Left" VerticalAlignment="Top"
                            Micro:Message.Attach="[Event ModeChanged] = [Action NavigatorModeChanged($eventArgs)]; [Event Zoomed] = [Action NavigatorZoomed($eventArgs)]; [Event Panned] = [Action NavigatorPanned($eventArgs)];" />

        <!--attributions-->
        <StackPanel Orientation="Horizontal" 
                    Margin="2" Grid.Row="0"
                    HorizontalAlignment="Right" 
                    VerticalAlignment="Bottom">

            <!--MapDotNet-->
            <Images:MDNSLogo Width="120" Margin="8,0,0,0" RenderTransformOrigin="0,1" VerticalAlignment="Bottom">
                <Images:MDNSLogo.RenderTransform>
                    <ScaleTransform ScaleX="0.3" ScaleY="0.3"/>
                </Images:MDNSLogo.RenderTransform>
            </Images:MDNSLogo>

            <!--Bing-->
            <Image Source="../Images/BingLogo.png" Width="80" Margin="8,0,0,10" VerticalAlignment="Bottom"/>
        </StackPanel>
    </Grid>
</UserControl>
